<!--
    page description : 비밀번호 변경 (pop_up)
    author      : Yang D
    date        : 2009-03-05
    file name   : passwordhange_pop.jsp
-->
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link rel="stylesheet" type="text/css" href="/inc/css/common.css" />
	<script src="inc/js/common.js"></script>
	<title>비밀번호 변경</title>
	<script type="text/javascript" language="javascript">
	
	// --------------------J A V A S C R I P T-START-------------------- //
		//저장버튼
		function fnc_submit(f) {
		
			if (f.current_pwd.value == ""){
				alert("<s:text name="alert.message.invalidPassword" />");
				f.current_pwd.focus();
				return false;
			}
			
			if (f.new_pwd_1.value == "") {
				alert("입력하신 <s:text name="alert.message.invalidPassword" />");
				f.new_pwd_1.focus();
				return false;
			}
			
			if (f.new_pwd_2.value == "") {
				alert("입력하신 <s:text name="alert.message.invalidPassword" />");
				f.new_pwd_2.focus();
				return false;
			}
			
			if (f.new_pwd_1.value != f.new_pwd_2.value) {
				alert("<s:text name="alert.message.notMatchPassword" />");
				f.new_pwd_2.value == "";
				f.new_pwd_2.focus();
				return false;
			}
			
			if (!confirm("비밀번호를 <s:text name="alert.message.confirmModify" />")) {
	        	return false;
	        }
			
			f.action = "updatePassword.action";
		}
		
		//
	    function fnc_apply_change() {
	
	        var rtn_msg = document.getElementById("msg").value;
	        
	        if(rtn_msg == "OK") {
	            alert("비밀번호가 <s:text name="alert.message.modified" />");
	            window.close();
	        } else if(rtn_msg == "NOTEXIST") {
	        	alert("현재 <s:text name="alert.message.invalidPassword" />");
	        	document.frm.current_pwd.value = "";
	        	document.frm.current_pwd.focus();
	        	return false;
	        } else if (rtn_msg == "FAILE") {
	        	alert("비밀번호가  <s:text name="alert.message.notModified" />");
	        	return false;
	        }

	    }
	//-- --------------------J A V A S C R I P T-E N D-------------------- //
	</script>
</head>
<body onload="fnc_apply_change()">
	<s:form name="frm" id="frm" method="post" theme="simple" onsubmit="return fnc_submit(this)">
		<s:hidden name="msg" 		id="msg"		/>			<!-- 저장 메시지 출력 -->
		<s:hidden name="emp_no" 	id="emp_no"		/>			<!-- 저장 메시지 출력 -->
		<s:hidden name="user_id" 	id="user_id"	/>			<!-- 저장 메시지 출력 -->
	 	<div id="popup_350se_top"></div>
	<div id="popup_350se_bg">
		<div id="popup_325see">
			<div id="popup_325se_box">
		 		<ul>
					<li class="txt">현재 비밀번호</li>
					<li><s:password name="current_pwd" id="current_pwd"  cssClass="input_120se" maxlength="10" /></li>
				</ul>
				<ul>
					<li class="txt">변경할 비밀번호</li>
					<li ><s:password name="new_pwd_1" id="new_pwd_1"  cssClass="input_120se" maxlength="10"/></li>
				</ul>
				<ul>
					<li class="txt">변경할 비밀번호 확인</li>
					<li><s:password name="new_pwd_2" id="new_pwd_2" cssClass="input_120se" maxlength="10"/></li>
				</ul>
				<div id="popup_btn"><input type="image" value="저장" src="/images/btn_save.gif"  /></div>
			</div>
		</div>
	</div>
	<!---------------Bottom : STR----------->
	<div id="popup_350se_bottom"><img type="image" src="/images/pop_btn_close.gif" style="cursor: pointer;" onclick="window.close(); return false;"/></div>
	<!---------------Bottom : END----------->
	</s:form>
</body>
</html>